package com.yuyou.tas.util.enums.admin;

public class CommJobEnums {

	/**
	 * 最大重试次数
	 * @author ZY
	 *
	 */
	public enum maxTime{		
		resource(3) , feedbackSituation(3) , feedbackNote(3);
		maxTime(int maxTime){
			this.maxTime=maxTime;
		}
		private int maxTime;

		public static int getByType(int type) {
			if(type == CommJobEnums.type.resource.getValue()){
				return resource.getMaxTime();
			}else if(type == CommJobEnums.type.feedbackSituation.getValue()){
				return feedbackSituation.getMaxTime();
			}else if(type == CommJobEnums.type.feedbackNote.getValue()){
				return resource.getMaxTime();
			}
			return 0;
		}
		
		public int getMaxTime() {
			return maxTime;
		}		
	}

	public enum needRetry{
		resource(1) , feedbackSituation(1) , feedbackNote(1);
		private int needRetry;
		needRetry(int needRetry){
			this.needRetry=needRetry;
		}
		public static int getByType(int type) {
			if(type == CommJobEnums.type.resource.getValue()){
				return resource.needRetry();
			}else if(type == CommJobEnums.type.feedbackSituation.getValue()){
				return feedbackSituation.needRetry();
			}else if(type == CommJobEnums.type.feedbackNote.getValue()){
				return resource.needRetry();
			}
			return 1;
		}
		public int needRetry() {
			return needRetry;
		}
	}
	
	/**
	 * 间隔（分钟）
	 * @author ZY
	 *
	 */
	public enum interval{		
		i1(30) , i2(120) , i3(240);
		interval(int maxTime){
			this.maxTime=maxTime;
		}

		public static int getMaxByTimes(int time){
			if(time == 1){
				return i1.getMaxTime();
			}else if(time == 2){
				return i2.getMaxTime();
			}
			return  i3.getMaxTime();
		}

		private int maxTime;
		
		public int getMaxTime() {
			return maxTime;
		}		
	}
	
	
	
	
	
	
	/**
	 * 类型 1、资源，2、反馈内容，3、反馈优秀笔记
	 */
	public enum type{		
		resource(1) , feedbackSituation(2) , feedbackNote(3);
		type(int value){
			this.value=value;
		}		
		private int value;
		public int getValue() {
			return value;
		}			
	}
	
	/**
	 * 类型 1、资源，2、反馈内容，3、反馈优秀笔记
	 *
	 */
	public enum tag{		
		resource("resource") , feedbackSituation("feedbackSituation") , feedbackNote("feedbackNote");
		tag(String value){
			this.value=value;
		}		
		private String value;
		public String getValue() {
			return value;
		}			
	}

	/**
	 * 状态：0:待处理，1:已分派，2:处理中，3:成功，4:失败，5:取消
	 *
	 */
	public enum status{		
		init(0),sended(1),dealing(2),success(3),fail(4),cancel(5);
		status(int value){
			this.value=value;
		}		
		private int value;
		public int getValue() {
			return value;
		}			
	}
}
